import java.util.Stack;

public class a {
    Stack<Node> stack=new Stack<>();
//    寻找node节点的路径
    public static boolean aa(Node root,Node node,Stack<Node> stack){
        if (root==null){
            return false;
        }
        if (root.val==node.val){
            stack.push(root);
            return true;
        }
        boolean ret1=aa(root.left,node,stack);
        if (ret1){
            stack.push(root);
            return true;
        }
        boolean ret2=aa(root.right,node,stack);
        if (ret2){
            stack.push(root);
            return true;
        }
        return false;
    }
}
